package com.street.mapper;

import com.street.entity.Orders;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;

@Mapper
public interface OrderMapper {

    @Insert("insert into orders(number, status, user_id,shop_id, order_time, checkout_time, amount, remark, phone, " +
            " user_name,  cancel_reason,  cancel_time" +
            ", estimated_delivery_time,  delivery_time) " +
            "values (#{number},#{status},#{userId},#{shopId}，#{orderTime},#{checkoutTime},#{payStatus},#{amount},#{remark},#{phone}," +
            "#{userName},#{cancelReason}," +
            "#{cancelTime},#{estimatedDeliveryTime},#{deliveryTime})")
    @Options(useGeneratedKeys = true,keyProperty = "id")
    void insert(Orders order);
}
